<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libslic3r: src/libslic3r/Surface.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Slic3r_192px_transparent.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libslic3r
   </div>
   <div id="projectbrief">Library for generating gcode from 3d models</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_f69e6fbaea45487e96bc9ed8ccf9ff8f.html">libslic3r</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Surface.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_surface_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef slic3r_Surface_hpp_</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define slic3r_Surface_hpp_</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="libslic3r_8h.html">libslic3r.h</a>&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_ex_polygon_8hpp.html">ExPolygon.hpp</a>&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_slic3r.html">Slic3r</a> {</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8">    9</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8">SurfaceType</a> { <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8aa3e83e2525b93a5c51ec229e162a2ccd">stTop</a>, <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8ab3debd493fa32670a648bf75c9851fa2">stBottom</a>, <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8aab7b75c6465c93d9f8a8d76ab5494037">stBottomBridge</a>, <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8a8f516f8e4fc6924f168bc89064630424">stInternal</a>, <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8a269095bfecb443da8bf409bcb45aae6b">stInternalSolid</a>, <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8aa59dd787a96d953b18df9af4da18f17d">stInternalBridge</a>, <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8ad4eb4c291134fe939028330730d70677">stInternalVoid</a> };</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html">   11</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_slic3r_1_1_surface.html">Surface</a></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;{</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html#a33b43f3aa62e3ef32b0100ea289532fd">   14</a></span>&#160;    <a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8">SurfaceType</a>     <a class="code" href="class_slic3r_1_1_surface.html#a33b43f3aa62e3ef32b0100ea289532fd">surface_type</a>;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html#ab98ce319a0960df1324252d0d9240463">   15</a></span>&#160;    <a class="code" href="class_slic3r_1_1_ex_polygon.html">ExPolygon</a>       <a class="code" href="class_slic3r_1_1_surface.html#ab98ce319a0960df1324252d0d9240463">expolygon</a>;</div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html#ad074c9bedd8dbe04178c1f8c2f750c37">   16</a></span>&#160;    <span class="keywordtype">double</span>          <a class="code" href="class_slic3r_1_1_surface.html#ad074c9bedd8dbe04178c1f8c2f750c37">thickness</a>;          <span class="comment">// in mm</span></div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html#a5c5bda1feccd103ba8bfdd89818fc1c2">   17</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>  <a class="code" href="class_slic3r_1_1_surface.html#a5c5bda1feccd103ba8bfdd89818fc1c2">thickness_layers</a>;   <span class="comment">// in layers</span></div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html#aaa7cb31ff126b05381ed24037410de25">   18</a></span>&#160;    <span class="keywordtype">double</span>          <a class="code" href="class_slic3r_1_1_surface.html#aaa7cb31ff126b05381ed24037410de25">bridge_angle</a>;       <span class="comment">// in radians, ccw, 0 = East, only 0+ (negative means undefined)</span></div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html#a8fb62a4d35aa78e6bff3ae80abd3ecca">   19</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>  <a class="code" href="class_slic3r_1_1_surface.html#a8fb62a4d35aa78e6bff3ae80abd3ecca">extra_perimeters</a>;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    </div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_slic3r_1_1_surface.html#aa6035b9d17cf8a375cf518901052a9e9">   21</a></span>&#160;    <a class="code" href="class_slic3r_1_1_surface.html#aa6035b9d17cf8a375cf518901052a9e9">Surface</a>(<a class="code" href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8">SurfaceType</a> _surface_type, <span class="keyword">const</span> <a class="code" href="class_slic3r_1_1_ex_polygon.html">ExPolygon</a> &amp;_expolygon)</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        : surface_type(_surface_type), expolygon(_expolygon),</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;            thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0)</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        {};</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keyword">operator</span> <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_slic3r_1_1_surface.html#a82e06afa114f5d0ecc72827a2ed6cc62">area</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_slic3r_1_1_surface.html#a38efc34cc8421e6059d556089c62e606">is_solid</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_slic3r_1_1_surface.html#a7fa6cd63ba516167d4853abc330f8482">is_external</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_slic3r_1_1_surface.html#aa3eef69841a13a1da6f90b0e24753e27">is_internal</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_slic3r_1_1_surface.html#a59f23864153e397680a77843af60db37">is_bottom</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_slic3r_1_1_surface.html#a53188bd4cc36dd6c64f22a208bbf2bb2">is_bridge</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;};</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a974dd7a4e3e39746ab1e4197e1aa54b0">   34</a></span>&#160;<span class="keyword">typedef</span> std::vector&lt;Surface&gt; <a class="code" href="namespace_slic3r.html#a974dd7a4e3e39746ab1e4197e1aa54b0">Surfaces</a>;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a07ec75e65c5a526deed75bc28a762789">   35</a></span>&#160;<span class="keyword">typedef</span> std::vector&lt;Surface*&gt; <a class="code" href="namespace_slic3r.html#a07ec75e65c5a526deed75bc28a762789">SurfacesPtr</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a72c059081faf53ac431ac80f76267c1f">   36</a></span>&#160;<span class="keyword">typedef</span> std::vector&lt;const Surface*&gt; <a class="code" href="namespace_slic3r.html#a72c059081faf53ac431ac80f76267c1f">SurfacesConstPtr</a>;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">inline</span> <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#ac55cedaece1d416b5ff25319d32f701f">   39</a></span>&#160;<a class="code" href="namespace_slic3r.html#a3fc83fb12ccc400510159a3438d02487">to_polygons</a>(<span class="keyword">const</span> Surfaces &amp;surfaces)</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Slic3r::Polygons</a> pp;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordflow">for</span> (Surfaces::const_iterator s = surfaces.begin(); s != surfaces.end(); ++s)</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <a class="code" href="namespace_slic3r.html#acf7db809cbd1d919d0bd314f5fbdf4a9">append_to</a>(pp, (<a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a>)*s);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keywordflow">return</span> pp;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;}</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">inline</span> <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a></div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a5592430e9c33f877b965f27487333e73">   48</a></span>&#160;<a class="code" href="namespace_slic3r.html#a3fc83fb12ccc400510159a3438d02487">to_polygons</a>(<span class="keyword">const</span> SurfacesPtr &amp;surfaces)</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;{</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Slic3r::Polygons</a> pp;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keywordflow">for</span> (SurfacesPtr::const_iterator s = surfaces.begin(); s != surfaces.end(); ++s)</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <a class="code" href="namespace_slic3r.html#acf7db809cbd1d919d0bd314f5fbdf4a9">append_to</a>(pp, (<a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a>)**s);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordflow">return</span> pp;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;}</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">inline</span> <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a></div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#ab930dd5f7ec201a43f282ee7d75215c3">   57</a></span>&#160;<a class="code" href="namespace_slic3r.html#a3fc83fb12ccc400510159a3438d02487">to_polygons</a>(<span class="keyword">const</span> SurfacesConstPtr &amp;surfaces)</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;{</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Slic3r::Polygons</a> pp;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordflow">for</span> (SurfacesConstPtr::const_iterator s = surfaces.begin(); s != surfaces.end(); ++s)</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <a class="code" href="namespace_slic3r.html#acf7db809cbd1d919d0bd314f5fbdf4a9">append_to</a>(pp, (<a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a>)**s);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordflow">return</span> pp;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;}</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a2b51533ee48410cf5bffae83dd9216ff">   65</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">ExPolygons</a> <a class="code" href="namespace_slic3r.html#a2b51533ee48410cf5bffae83dd9216ff">to_expolygons</a>(<span class="keyword">const</span> Surfaces &amp;src)</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;{</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <a class="code" href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">ExPolygons</a> expolygons;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    expolygons.reserve(src.size());</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordflow">for</span> (Surfaces::const_iterator it = src.begin(); it != src.end(); ++it)</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        expolygons.push_back(it-&gt;expolygon);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keywordflow">return</span> expolygons;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;}</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#aeac2d0267da6babaa5d8313e5af93f3e">   74</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">ExPolygons</a> <a class="code" href="namespace_slic3r.html#a2b51533ee48410cf5bffae83dd9216ff">to_expolygons</a>(Surfaces &amp;&amp;src)</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;{</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <a class="code" href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">ExPolygons</a> expolygons;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    expolygons.reserve(src.size());</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordflow">for</span> (Surfaces::const_iterator it = src.begin(); it != src.end(); ++it)</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        expolygons.emplace_back(<a class="code" href="class_slic3r_1_1_ex_polygon.html">ExPolygon</a>(std::move(it-&gt;expolygon)));</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    src.clear();</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keywordflow">return</span> expolygons;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;}</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#af64eb3a9922465ea028fef9a3b9e9066">   84</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">ExPolygons</a> <a class="code" href="namespace_slic3r.html#a2b51533ee48410cf5bffae83dd9216ff">to_expolygons</a>(<span class="keyword">const</span> SurfacesPtr &amp;src)</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;{</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <a class="code" href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">ExPolygons</a> expolygons;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    expolygons.reserve(src.size());</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">for</span> (SurfacesPtr::const_iterator it = src.begin(); it != src.end(); ++it)</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        expolygons.push_back((*it)-&gt;expolygon);</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keywordflow">return</span> expolygons;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;}</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="comment">// Count a nuber of polygons stored inside the vector of expolygons.</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">// Useful for allocating space for polygons when converting expolygons to polygons.</span></div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">   96</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">number_polygons</a>(<span class="keyword">const</span> Surfaces &amp;surfaces)</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;{</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordtype">size_t</span> n_polygons = 0;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordflow">for</span> (Surfaces::const_iterator it = surfaces.begin(); it != surfaces.end(); ++ it)</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        n_polygons += it-&gt;expolygon.holes.size() + 1;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">return</span> n_polygons;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;}</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a8071ed81a167a898cc2784c563f7cbd0">  104</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">number_polygons</a>(<span class="keyword">const</span> SurfacesPtr &amp;surfaces)</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;{</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordtype">size_t</span> n_polygons = 0;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordflow">for</span> (SurfacesPtr::const_iterator it = surfaces.begin(); it != surfaces.end(); ++ it)</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        n_polygons += (*it)-&gt;expolygon.holes.size() + 1;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordflow">return</span> n_polygons;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;}</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="comment">// Append a vector of Surfaces at the end of another vector of polygons.</span></div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a4aaedea5a4498045fdcc52a237700929">  113</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespace_slic3r.html#a4aaedea5a4498045fdcc52a237700929">polygons_append</a>(<a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a> &amp;dst, <span class="keyword">const</span> Surfaces &amp;src)</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;{</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    dst.reserve(dst.size() + <a class="code" href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">number_polygons</a>(src));</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordflow">for</span> (Surfaces::const_iterator it = src.begin(); it != src.end(); ++ it) {</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        dst.push_back(it-&gt;expolygon.contour);</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        dst.insert(dst.end(), it-&gt;expolygon.holes.begin(), it-&gt;expolygon.holes.end());</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    }</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;}</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a6041eb3bce5a84c94e4d23f67afb5658">  122</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespace_slic3r.html#a4aaedea5a4498045fdcc52a237700929">polygons_append</a>(<a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a> &amp;dst, Surfaces &amp;&amp;src)</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;{</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    dst.reserve(dst.size() + <a class="code" href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">number_polygons</a>(src));</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keywordflow">for</span> (Surfaces::iterator it = src.begin(); it != src.end(); ++ it) {</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        dst.push_back(std::move(it-&gt;expolygon.contour));</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        std::move(std::begin(it-&gt;expolygon.holes), std::end(it-&gt;expolygon.holes), std::back_inserter(dst));</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        it-&gt;expolygon.holes.clear();</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    }</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;}</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment">// Append a vector of Surfaces at the end of another vector of polygons.</span></div><div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#a500908ad97c4bdeb7d592ab1f0b3f781">  133</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespace_slic3r.html#a4aaedea5a4498045fdcc52a237700929">polygons_append</a>(<a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a> &amp;dst, <span class="keyword">const</span> SurfacesPtr &amp;src)</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;{</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    dst.reserve(dst.size() + <a class="code" href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">number_polygons</a>(src));</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keywordflow">for</span> (SurfacesPtr::const_iterator it = src.begin(); it != src.end(); ++ it) {</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;        dst.push_back((*it)-&gt;expolygon.contour);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        dst.insert(dst.end(), (*it)-&gt;expolygon.holes.begin(), (*it)-&gt;expolygon.holes.end());</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    }</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;}</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="namespace_slic3r.html#ab7eee0816207b6ba3e468b9167ea0a69">  142</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespace_slic3r.html#a4aaedea5a4498045fdcc52a237700929">polygons_append</a>(<a class="code" href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Polygons</a> &amp;dst, SurfacesPtr &amp;&amp;src)</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;{</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    dst.reserve(dst.size() + <a class="code" href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">number_polygons</a>(src));</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keywordflow">for</span> (SurfacesPtr::const_iterator it = src.begin(); it != src.end(); ++ it) {</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        dst.push_back(std::move((*it)-&gt;expolygon.contour));</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        std::move(std::begin((*it)-&gt;expolygon.holes), std::end((*it)-&gt;expolygon.holes), std::back_inserter(dst));</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        (*it)-&gt;expolygon.holes.clear();</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;}</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;}</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="class_slic3r_1_1_surface_html_a38efc34cc8421e6059d556089c62e606"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a38efc34cc8421e6059d556089c62e606">Slic3r::Surface::is_solid</a></div><div class="ttdeci">bool is_solid() const</div><div class="ttdef"><b>Definition:</b> Surface.cpp:17</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8ab3debd493fa32670a648bf75c9851fa2"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8ab3debd493fa32670a648bf75c9851fa2">Slic3r::stBottom</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_aaa7cb31ff126b05381ed24037410de25"><div class="ttname"><a href="class_slic3r_1_1_surface.html#aaa7cb31ff126b05381ed24037410de25">Slic3r::Surface::bridge_angle</a></div><div class="ttdeci">double bridge_angle</div><div class="ttdef"><b>Definition:</b> Surface.hpp:18</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8aab7b75c6465c93d9f8a8d76ab5494037"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8aab7b75c6465c93d9f8a8d76ab5494037">Slic3r::stBottomBridge</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="libslic3r_8h_html"><div class="ttname"><a href="libslic3r_8h.html">libslic3r.h</a></div></div>
<div class="ttc" id="namespace_slic3r_html_a72c059081faf53ac431ac80f76267c1f"><div class="ttname"><a href="namespace_slic3r.html#a72c059081faf53ac431ac80f76267c1f">Slic3r::SurfacesConstPtr</a></div><div class="ttdeci">std::vector&lt; const Surface * &gt; SurfacesConstPtr</div><div class="ttdef"><b>Definition:</b> Surface.hpp:36</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_a7fa6cd63ba516167d4853abc330f8482"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a7fa6cd63ba516167d4853abc330f8482">Slic3r::Surface::is_external</a></div><div class="ttdeci">bool is_external() const</div><div class="ttdef"><b>Definition:</b> Surface.cpp:27</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_ab98ce319a0960df1324252d0d9240463"><div class="ttname"><a href="class_slic3r_1_1_surface.html#ab98ce319a0960df1324252d0d9240463">Slic3r::Surface::expolygon</a></div><div class="ttdeci">ExPolygon expolygon</div><div class="ttdef"><b>Definition:</b> Surface.hpp:15</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8a8f516f8e4fc6924f168bc89064630424"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8a8f516f8e4fc6924f168bc89064630424">Slic3r::stInternal</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_a59f23864153e397680a77843af60db37"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a59f23864153e397680a77843af60db37">Slic3r::Surface::is_bottom</a></div><div class="ttdeci">bool is_bottom() const</div><div class="ttdef"><b>Definition:</b> Surface.cpp:44</div></div>
<div class="ttc" id="namespace_slic3r_html_acf7db809cbd1d919d0bd314f5fbdf4a9"><div class="ttname"><a href="namespace_slic3r.html#acf7db809cbd1d919d0bd314f5fbdf4a9">Slic3r::append_to</a></div><div class="ttdeci">void append_to(std::vector&lt; T &gt; &amp;dst, const std::vector&lt; T &gt; &amp;src)</div><div class="ttdef"><b>Definition:</b> libslic3r.h:72</div></div>
<div class="ttc" id="namespace_slic3r_html_ac070ff2d90c6488a48adf1814cdae06c"><div class="ttname"><a href="namespace_slic3r.html#ac070ff2d90c6488a48adf1814cdae06c">Slic3r::Polygons</a></div><div class="ttdeci">std::vector&lt; Polygon &gt; Polygons</div><div class="ttdef"><b>Definition:</b> Polygon.hpp:13</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_a53188bd4cc36dd6c64f22a208bbf2bb2"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a53188bd4cc36dd6c64f22a208bbf2bb2">Slic3r::Surface::is_bridge</a></div><div class="ttdeci">bool is_bridge() const</div><div class="ttdef"><b>Definition:</b> Surface.cpp:51</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8a269095bfecb443da8bf409bcb45aae6b"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8a269095bfecb443da8bf409bcb45aae6b">Slic3r::stInternalSolid</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_aa6035b9d17cf8a375cf518901052a9e9"><div class="ttname"><a href="class_slic3r_1_1_surface.html#aa6035b9d17cf8a375cf518901052a9e9">Slic3r::Surface::Surface</a></div><div class="ttdeci">Surface(SurfaceType _surface_type, const ExPolygon &amp;_expolygon)</div><div class="ttdef"><b>Definition:</b> Surface.hpp:21</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8ad4eb4c291134fe939028330730d70677"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8ad4eb4c291134fe939028330730d70677">Slic3r::stInternalVoid</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="namespace_slic3r_html_a974dd7a4e3e39746ab1e4197e1aa54b0"><div class="ttname"><a href="namespace_slic3r.html#a974dd7a4e3e39746ab1e4197e1aa54b0">Slic3r::Surfaces</a></div><div class="ttdeci">std::vector&lt; Surface &gt; Surfaces</div><div class="ttdef"><b>Definition:</b> Surface.hpp:34</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_a8fb62a4d35aa78e6bff3ae80abd3ecca"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a8fb62a4d35aa78e6bff3ae80abd3ecca">Slic3r::Surface::extra_perimeters</a></div><div class="ttdeci">unsigned short extra_perimeters</div><div class="ttdef"><b>Definition:</b> Surface.hpp:19</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_a33b43f3aa62e3ef32b0100ea289532fd"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a33b43f3aa62e3ef32b0100ea289532fd">Slic3r::Surface::surface_type</a></div><div class="ttdeci">SurfaceType surface_type</div><div class="ttdef"><b>Definition:</b> Surface.hpp:14</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8aa3e83e2525b93a5c51ec229e162a2ccd"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8aa3e83e2525b93a5c51ec229e162a2ccd">Slic3r::stTop</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8">Slic3r::SurfaceType</a></div><div class="ttdeci">SurfaceType</div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="namespace_slic3r_html_a2b51533ee48410cf5bffae83dd9216ff"><div class="ttname"><a href="namespace_slic3r.html#a2b51533ee48410cf5bffae83dd9216ff">Slic3r::to_expolygons</a></div><div class="ttdeci">ExPolygons to_expolygons(const Surfaces &amp;src)</div><div class="ttdef"><b>Definition:</b> Surface.hpp:65</div></div>
<div class="ttc" id="namespace_slic3r_html_a4aaedea5a4498045fdcc52a237700929"><div class="ttname"><a href="namespace_slic3r.html#a4aaedea5a4498045fdcc52a237700929">Slic3r::polygons_append</a></div><div class="ttdeci">void polygons_append(Polygons &amp;dst, const Surfaces &amp;src)</div><div class="ttdef"><b>Definition:</b> Surface.hpp:113</div></div>
<div class="ttc" id="namespace_slic3r_html"><div class="ttname"><a href="namespace_slic3r.html">Slic3r</a></div><div class="ttdef"><b>Definition:</b> BoundingBox.cpp:4</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_a82e06afa114f5d0ecc72827a2ed6cc62"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a82e06afa114f5d0ecc72827a2ed6cc62">Slic3r::Surface::area</a></div><div class="ttdeci">double area() const</div><div class="ttdef"><b>Definition:</b> Surface.cpp:11</div></div>
<div class="ttc" id="class_slic3r_1_1_ex_polygon_html"><div class="ttname"><a href="class_slic3r_1_1_ex_polygon.html">Slic3r::ExPolygon</a></div><div class="ttdef"><b>Definition:</b> ExPolygon.hpp:16</div></div>
<div class="ttc" id="namespace_slic3r_html_abe9699b26eb18f6636b045c930d167d8aa59dd787a96d953b18df9af4da18f17d"><div class="ttname"><a href="namespace_slic3r.html#abe9699b26eb18f6636b045c930d167d8aa59dd787a96d953b18df9af4da18f17d">Slic3r::stInternalBridge</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:9</div></div>
<div class="ttc" id="namespace_slic3r_html_a436ba7aff8e795a5ae518eb45504a927"><div class="ttname"><a href="namespace_slic3r.html#a436ba7aff8e795a5ae518eb45504a927">Slic3r::number_polygons</a></div><div class="ttdeci">size_t number_polygons(const Surfaces &amp;surfaces)</div><div class="ttdef"><b>Definition:</b> Surface.hpp:96</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_ad074c9bedd8dbe04178c1f8c2f750c37"><div class="ttname"><a href="class_slic3r_1_1_surface.html#ad074c9bedd8dbe04178c1f8c2f750c37">Slic3r::Surface::thickness</a></div><div class="ttdeci">double thickness</div><div class="ttdef"><b>Definition:</b> Surface.hpp:16</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_a5c5bda1feccd103ba8bfdd89818fc1c2"><div class="ttname"><a href="class_slic3r_1_1_surface.html#a5c5bda1feccd103ba8bfdd89818fc1c2">Slic3r::Surface::thickness_layers</a></div><div class="ttdeci">unsigned short thickness_layers</div><div class="ttdef"><b>Definition:</b> Surface.hpp:17</div></div>
<div class="ttc" id="namespace_slic3r_html_a07ec75e65c5a526deed75bc28a762789"><div class="ttname"><a href="namespace_slic3r.html#a07ec75e65c5a526deed75bc28a762789">Slic3r::SurfacesPtr</a></div><div class="ttdeci">std::vector&lt; Surface * &gt; SurfacesPtr</div><div class="ttdef"><b>Definition:</b> Surface.hpp:35</div></div>
<div class="ttc" id="namespace_slic3r_html_a9306b728b4672f5e56abe05ba7437fe1"><div class="ttname"><a href="namespace_slic3r.html#a9306b728b4672f5e56abe05ba7437fe1">Slic3r::ExPolygons</a></div><div class="ttdeci">std::vector&lt; ExPolygon &gt; ExPolygons</div><div class="ttdef"><b>Definition:</b> ExPolygon.hpp:13</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html_aa3eef69841a13a1da6f90b0e24753e27"><div class="ttname"><a href="class_slic3r_1_1_surface.html#aa3eef69841a13a1da6f90b0e24753e27">Slic3r::Surface::is_internal</a></div><div class="ttdeci">bool is_internal() const</div><div class="ttdef"><b>Definition:</b> Surface.cpp:35</div></div>
<div class="ttc" id="namespace_slic3r_html_a3fc83fb12ccc400510159a3438d02487"><div class="ttname"><a href="namespace_slic3r.html#a3fc83fb12ccc400510159a3438d02487">Slic3r::to_polygons</a></div><div class="ttdeci">Polygons to_polygons(const ExPolygons &amp;expolygons)</div><div class="ttdef"><b>Definition:</b> ExPolygon.hpp:56</div></div>
<div class="ttc" id="class_slic3r_1_1_surface_html"><div class="ttname"><a href="class_slic3r_1_1_surface.html">Slic3r::Surface</a></div><div class="ttdef"><b>Definition:</b> Surface.hpp:11</div></div>
<div class="ttc" id="_ex_polygon_8hpp_html"><div class="ttname"><a href="_ex_polygon_8hpp.html">ExPolygon.hpp</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
